<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/static/common/taglibs.jsp" %>
<script>
    $(document).ready(function () {

    });
</script>
<div class="page">
    <div class="pageHeader">
        <form id="pagerForm" onsubmit="return navTabSearch(this);"
              action="${ctx}/ring" method="post">
            <!--Begin page Search -->
            <input type="hidden" id="numPerPage" name="page.pageSize"
                   value="${page.pageSize}"/> <input type="hidden" name="page.pageNo"
                                                     id="pageNum" value="${page.pageNo}"/> <input type="hidden"
                                                                                                  name="page.orderBy"
                                                                                                  id="orderField"
                                                                                                  value="${page.orderBy}"/>
            <input
                    type="hidden" name="page.order" id="order" value="${page.order}"/>
            <!--End page Search -->
            <div class="searchBar">
                <ul class="searchContent">
                    <li style="width: 175px;"><label style="width: 50px;">款号:</label><input
                            type="text" name="filter_LIKE_no" style="width: 100px;"
                            value="${param['filter_LIKE_no']}" size="10"/></li>

					<li style="width: 175px;"><label style="width: 50px;">名称:</label><input
                            type="text" name="filter_LIKE_name" style="width: 100px;"
                            value="${param['filter_LIKE_name']}" size="10"/></li>

                    <li style="width: 275px;"><label style="width: 50px;">类型：</label><select
                            name="filter_EQ_ringType.id" class="combox"
                            onchange="javascript:$('#typeListSearchSubmit').click();" id="ringType">
                        <option value="">全部类型</option>
                        <c:forEach items="${ringTypes}" var="model">
                            <option value="${model.id}"
                                    <c:if test="${model.id==param['filter_EQ_ringType.id']}">selected="selected"</c:if>>${model.name}</option>
                        </c:forEach>
                    </select></li>

                </ul>
                <div class="subBar">
                    <ul>
                        <li>
                            <div class="buttonActive">
                                <div class="buttonContent">
                                    <button type="submit" id="typeListSearchSubmit">检索</button>
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </form>
    </div>

    <div class="pageContent">
        <div class="panelBar">
            <ul class="toolBar" id="bar">
                <c:if test="${cUser.type==0 }">
                    <c:if test="${''!=ringType and null!=ringType}">
                        <li class="line">line</li>
                        <li id="addLi"><a class="add" href="${ctx}/ring/input/0/${ringType}"
                                          target="dialog" width="500" height="500" rel="ring_input"><span>添加</span>
                        </a></li>
                    </c:if>
                    <li class="line">line</li>
                    <li><a class="delete" href="${ctx}/ring/deletes"
                           target="selectedTodo" title="确实要删除这些记录吗?"><span>删除</span> </a></li>

                </c:if>
                <c:if test="${cUser.type==1 }">
                    <li><a class="add" href="${ctx}/ring/setDiscount"
                           target="dialog" width="400" height="400" rel="d_ringDiscount"><span>批量设置戒托批发价</span>
                    </a></li>
                     <li><span>当前倍数：${ringBaseNumber }</span></li>
                </c:if>
            </ul>
        </div>
        <div class="panelBar">
            <div class="pages">
                <span>每页显示</span> <select name="numPerPage"
                                          onchange="navTabPageBreak({numPerPage:this.value})">
                <c:forEach items="${selectPageList}" var="model">
                    <option value="${model.key}"
                            <c:if test="${model.key==page.pageSize}">selected="selected"</c:if>>${model.value}</option>
                </c:forEach>
            </select> <span>&nbsp;共${page.totalCount}条,共${page.totalPages}页</span>
            </div>
            <div class="pagination" targetType="navTab"
                 totalCount="${page.totalCount}" numPerPage="${page.pageSize}"
                 pageNumShown="10" currentPage="${page.pageNo}"></div>
        </div>
        <table class="table myTable" width="100%" layouth="148">
            <thead>
            <tr>
                <th width="3%"><input type="checkbox" class="checkboxCtrl"
                                      group="ids"></th>
                <th align="center">名称</th>
                <th align="center">款号</th>
                <th align="center">主钻重量</th>
                <th align="center">主钻形状</th>
                <th align="center">金重</th>
                <th align="center">材质</th>
                <th align="center">副钻总重量</th>
                <th align="center">指圈</th>
                <th align="center">价格</th>
                <c:if test="${cUser.type==1 }">
                    <th align="center">二级批发价</th>
                </c:if>
                <th align="center">操作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${page.result}" var="ring" varStatus="index">
                <tr target="sid_id" rel="${ring.id}">
                    <td><input type="checkbox" value="${ring.id}" name="ids"></td>
                    <td>${ring.name }</td>
                    <td>${ring.no }</td>
                    <td>${ring.mainBeginWeigh }—${ring.mainEndWeigh }</td>
                    <td>${ring.mainShape }</td>
                    <td>${ring.goldWeight }</td>
                    <td>${ring.quality }</td>
                    <td>${ring.minorWeigh }</td>
                    <td>${ring.sizeBegin }—${ring.sizeEnd }</td>
                    <td>${ring.price}</td>
                    <c:if test="${cUser.type==1 }">
                    <td>${ring.secondPrice}</td>
                    </c:if>

                    <td>
                        <c:if test="${cUser.type==0 }">
                        <a  href="${ctx}/ring/delete/${ring.id}"
                           target="ajaxTodo" title="确定要删除吗？">删除</a>
                           &nbsp;&nbsp;
                        <a 
                           href="${ctx}/ring/input/${ring.id}/${ring.ringType.id}" width="800"
                           height="500" target="dialog" title="修改">修改</a>
                           &nbsp;&nbsp;
                        </c:if>
                        <a
                           href="${ctx}/ring/detail/${ring.id}" width="1000"
                           height="450" target="dialog" title="查看详情">查看详细</a>
                    </td>

                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
</div>
